<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Limits of Basic Types</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="prev" href="glib-Basic-Types.html" title="Basic Types">
<link rel="next" href="glib-Standard-Macros.html" title="Standard Macros">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-Basic-Types.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-fundamentals.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Standard-Macros.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#glib-Limits-of-Basic-Types.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#glib-Limits-of-Basic-Types.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="glib-Limits-of-Basic-Types"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="glib-Limits-of-Basic-Types.top_of_page"></a>Limits of Basic Types</span></h2>
<p>Limits of Basic Types — portable method of determining the limits of the standard types</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="glib-Limits-of-Basic-Types.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;glib.h&gt;

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT:CAPS" title="G_MININT">G_MININT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT:CAPS" title="G_MAXINT">G_MAXINT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT:CAPS" title="G_MAXUINT">G_MAXUINT</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINSHORT:CAPS" title="G_MINSHORT">G_MINSHORT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSHORT:CAPS" title="G_MAXSHORT">G_MAXSHORT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUSHORT:CAPS" title="G_MAXUSHORT">G_MAXUSHORT</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINLONG:CAPS" title="G_MINLONG">G_MINLONG</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXLONG:CAPS" title="G_MAXLONG">G_MAXLONG</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXULONG:CAPS" title="G_MAXULONG">G_MAXULONG</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT8:CAPS" title="G_MININT8">G_MININT8</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT8:CAPS" title="G_MAXINT8">G_MAXINT8</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT8:CAPS" title="G_MAXUINT8">G_MAXUINT8</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT16:CAPS" title="G_MININT16">G_MININT16</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT16:CAPS" title="G_MAXINT16">G_MAXINT16</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT16:CAPS" title="G_MAXUINT16">G_MAXUINT16</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT32:CAPS" title="G_MININT32">G_MININT32</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT32:CAPS" title="G_MAXINT32">G_MAXINT32</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT32:CAPS" title="G_MAXUINT32">G_MAXUINT32</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT64:CAPS" title="G_MININT64">G_MININT64</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT64:CAPS" title="G_MAXINT64">G_MAXINT64</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT64:CAPS" title="G_MAXUINT64">G_MAXUINT64</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSIZE:CAPS" title="G_MAXSIZE">G_MAXSIZE</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINSSIZE:CAPS" title="G_MINSSIZE">G_MINSSIZE</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSSIZE:CAPS" title="G_MAXSSIZE">G_MAXSSIZE</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINOFFSET:CAPS" title="G_MINOFFSET">G_MINOFFSET</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXOFFSET:CAPS" title="G_MAXOFFSET">G_MAXOFFSET</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINFLOAT:CAPS" title="G_MINFLOAT">G_MINFLOAT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXFLOAT:CAPS" title="G_MAXFLOAT">G_MAXFLOAT</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINDOUBLE:CAPS" title="G_MINDOUBLE">G_MINDOUBLE</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXDOUBLE:CAPS" title="G_MAXDOUBLE">G_MAXDOUBLE</a>
</pre>
</div>
<div class="refsect1">
<a name="glib-Limits-of-Basic-Types.description"></a><h2>Description</h2>
<p>
These macros provide a portable method to determine the limits of some of
the standard integer and floating point types.
</p>
</div>
<div class="refsect1">
<a name="glib-Limits-of-Basic-Types.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="G-MININT:CAPS"></a><h3>G_MININT</h3>
<pre class="programlisting">#define G_MININT INT_MIN
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXINT:CAPS"></a><h3>G_MAXINT</h3>
<pre class="programlisting">#define G_MAXINT INT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXUINT:CAPS"></a><h3>G_MAXUINT</h3>
<pre class="programlisting">#define G_MAXUINT UINT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MINSHORT:CAPS"></a><h3>G_MINSHORT</h3>
<pre class="programlisting">#define G_MINSHORT SHRT_MIN
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gshort" title="gshort"><span class="type">gshort</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXSHORT:CAPS"></a><h3>G_MAXSHORT</h3>
<pre class="programlisting">#define G_MAXSHORT SHRT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gshort" title="gshort"><span class="type">gshort</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXUSHORT:CAPS"></a><h3>G_MAXUSHORT</h3>
<pre class="programlisting">#define G_MAXUSHORT USHRT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gushort" title="gushort"><span class="type">gushort</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MINLONG:CAPS"></a><h3>G_MINLONG</h3>
<pre class="programlisting">#define G_MINLONG LONG_MIN
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXLONG:CAPS"></a><h3>G_MAXLONG</h3>
<pre class="programlisting">#define G_MAXLONG LONG_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXULONG:CAPS"></a><h3>G_MAXULONG</h3>
<pre class="programlisting">#define G_MAXULONG ULONG_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MININT8:CAPS"></a><h3>G_MININT8</h3>
<pre class="programlisting">#define G_MININT8 ((gint8)  0x80)
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint8" title="gint8"><span class="type">gint8</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXINT8:CAPS"></a><h3>G_MAXINT8</h3>
<pre class="programlisting">#define G_MAXINT8 ((gint8)  0x7f)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint8" title="gint8"><span class="type">gint8</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXUINT8:CAPS"></a><h3>G_MAXUINT8</h3>
<pre class="programlisting">#define G_MAXUINT8 ((guint8) 0xff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint8" title="guint8"><span class="type">guint8</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MININT16:CAPS"></a><h3>G_MININT16</h3>
<pre class="programlisting">#define G_MININT16 ((gint16)  0x8000)
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint16" title="gint16"><span class="type">gint16</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXINT16:CAPS"></a><h3>G_MAXINT16</h3>
<pre class="programlisting">#define G_MAXINT16 ((gint16)  0x7fff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint16" title="gint16"><span class="type">gint16</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXUINT16:CAPS"></a><h3>G_MAXUINT16</h3>
<pre class="programlisting">#define G_MAXUINT16 ((guint16) 0xffff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint16" title="guint16"><span class="type">guint16</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MININT32:CAPS"></a><h3>G_MININT32</h3>
<pre class="programlisting">#define G_MININT32 ((gint32)  0x80000000)
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint32" title="gint32"><span class="type">gint32</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXINT32:CAPS"></a><h3>G_MAXINT32</h3>
<pre class="programlisting">#define G_MAXINT32 ((gint32)  0x7fffffff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint32" title="gint32"><span class="type">gint32</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXUINT32:CAPS"></a><h3>G_MAXUINT32</h3>
<pre class="programlisting">#define G_MAXUINT32 ((guint32) 0xffffffff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint32" title="guint32"><span class="type">guint32</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MININT64:CAPS"></a><h3>G_MININT64</h3>
<pre class="programlisting">#define G_MININT64 ((gint64) G_GINT64_CONSTANT(0x8000000000000000))
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXINT64:CAPS"></a><h3>G_MAXINT64</h3>
<pre class="programlisting">#define G_MAXINT64 G_GINT64_CONSTANT(0x7fffffffffffffff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXUINT64:CAPS"></a><h3>G_MAXUINT64</h3>
<pre class="programlisting">#define G_MAXUINT64 G_GINT64_CONSTANT(0xffffffffffffffffU)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXSIZE:CAPS"></a><h3>G_MAXSIZE</h3>
<pre class="programlisting">#define G_MAXSIZE G_MAXULONG
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a>.
</p>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MINSSIZE:CAPS"></a><h3>G_MINSSIZE</h3>
<pre class="programlisting">#define G_MINSSIZE G_MINLONG
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a>.
</p>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXSSIZE:CAPS"></a><h3>G_MAXSSIZE</h3>
<pre class="programlisting">#define G_MAXSSIZE G_MAXLONG
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a>.
</p>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MINOFFSET:CAPS"></a><h3>G_MINOFFSET</h3>
<pre class="programlisting">#define G_MINOFFSET G_MININT64
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#goffset" title="goffset"><span class="type">goffset</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXOFFSET:CAPS"></a><h3>G_MAXOFFSET</h3>
<pre class="programlisting">#define G_MAXOFFSET G_MAXINT64
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#goffset" title="goffset"><span class="type">goffset</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MINFLOAT:CAPS"></a><h3>G_MINFLOAT</h3>
<pre class="programlisting">#define G_MINFLOAT FLT_MIN
</pre>
<p>
The minimum positive value which can be held in a <a class="link" href="glib-Basic-Types.html#gfloat" title="gfloat"><span class="type">gfloat</span></a>.
</p>
<p>
If you are interested in the smallest value which can be held in a <a class="link" href="glib-Basic-Types.html#gfloat" title="gfloat"><span class="type">gfloat</span></a>,
use -G_MAXFLOAT.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXFLOAT:CAPS"></a><h3>G_MAXFLOAT</h3>
<pre class="programlisting">#define G_MAXFLOAT FLT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gfloat" title="gfloat"><span class="type">gfloat</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MINDOUBLE:CAPS"></a><h3>G_MINDOUBLE</h3>
<pre class="programlisting">#define G_MINDOUBLE DBL_MIN
</pre>
<p>
The minimum positive value which can be held in a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a>.
</p>
<p>
If you are interested in the smallest value which can be held in a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a>,
use -G_MAXDOUBLE.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-MAXDOUBLE:CAPS"></a><h3>G_MAXDOUBLE</h3>
<pre class="programlisting">#define G_MAXDOUBLE DBL_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a>.
</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>